package com.kanas.webak.admin.repository;

import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;


import com.kanas.webak.admin.domain.AppUser;

public interface UserRepository extends CrudRepository<AppUser, String> {
	Page<AppUser> findAll(Pageable pageable);
	AppUser findByUsername(String username);
	
	@Query("select u from KanasWebakUser u join u.userRoles r where r.id=?1")
	Page<AppUser> findByRoleId(String roleId,Pageable pageable);
}